<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>蚂蚁部落</title>
<style type="text/css"> 
body{
 background:blue;
}
#box{
 width:200px;
 height:100px;
 background:red;
 text-align:center;
 line-height:100px;
}
</style>
</head>
<body>
<div id="box">蚂蚁部落</div>
</body>
</html>

从上面的代码可以看出，box元素与外围有一定的空隙，再来看一段代码实例:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>蚂蚁部落</title>
<style type="text/css"> 
body{
 background:blue;
 margin:0px;
}
#box{
 width:200px;
 height:100px;
 background:red;
 text-align:center;
 line-height:100px;
}
</style>
</head>
<body>
<div id="box">蚂蚁部落</div>
</body>
</html>